﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace SimpleInOutControl.DBModels
{
    /// <summary>
    /// 人员信息
    /// </summary>
    [SugarTable(TableDescription = "人员信息")]
    //[SugarIndex("Index_{table}_TriggerDate", nameof(TriggerDate), OrderByType.Asc)]
    public class PersonInfo
    {
        /// <summary>
        /// 人员ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "人员ID")]
        public int? ID { get; set; }
        /// <summary>
        /// 编号
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "编号")]
        public string? Number { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "姓名")]
        public string? Name { get; set; }
        /// <summary>
        /// 所属部门
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "所属部门")]
        public string? Department { get; set; }
        /// <summary>
        /// 职务
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "职务")]
        public string? Duties { get; set; }
        /// <summary>
        /// 启用状态
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "启用状态")]
        public bool? IsEnabled { get; set; } = true;
        /// <summary>
        /// 操作员
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "操作员")]
        public string? Operator { get; set; }
        /// <summary>
        /// 录入日期
        /// </summary>
        [SugarColumn(IsNullable = true, DefaultValue = "now()", ColumnDescription = "录入日期")]
        public DateTime? EntryDate { get; set; } = DateTime.Now;
        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "text", ColumnDescription = "备注")]
        public string? Notes { get; set; }
    }
}
